#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv){
	ros::init(argc, argv, "robot_tf_publisher");
	ros::NodeHandle node;
	tf::Transform transform;
	tf::TransformBroadcaster broadcaster;
    ros::Rate rate(100);
    //transform.setOrigin( tf::Vector3(2.0*sin(ros::Time::now().toSec()), 2.0*cos(ros::Time::now().toSec()), 0.0)  );
	while (node.ok()){
        // 静态坐标系
        // transform.setOrigin( tf::Vector3(0.0, 2.0, 0.0) );
        // transform.setRotation( tf::Quaternion(0, 0, 0, 1) );
        // 动态坐标系	
        transform.setRotation( tf::Quaternion(0, 0, 0, 1) );
        transform.setOrigin( tf::Vector3(2.0*sin(ros::Time::now().toSec()), 2.0*cos(ros::Time::now().toSec()), 0.0) );// camera_link 原点x y坐标随着时间变化的圆的参数方程 
		broadcaster.sendTransform( tf::StampedTransform(transform, ros::Time::now(), "base_link", "camera_link") );
        // broadcaster.sendTransform(tf::StampedTransform(tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.0, 2.0, 0.0)), ros::Time::now(),"base_link", "base_laser"));
		rate.sleep();
    }
	return 0;
}
